<?php
Class Order extends CActiveRecord{
    public static function model($class= __CLASS__){
        return parent::model($class);
    }
    Public function tableName(){
        return 'order';
    }

    public static function checkStatus($status){
        $order = Order::model()->findByAttributes(array('status'=>$status));
        $order_status = $order->status;
        if($order_status==1){
            return 'Đã Giao';
        } else {
            return 'Chưa Giao';
        }
    }

    public static function checkAuthentication($authentication){
        $order = Order::model()->findByAttributes(array('Authentication'=>$authentication));
        $order_authentication = $order->Authentication;
        if($order_authentication==1){
            return 'Đã Xac Nhan';
        } else {
            return 'Chưa Xac Nhan';
        }
    }
}